module dtl.io.output_range;

private import std.stream;

class ostream_range
{
  this(OutputStream os, string sep) 
  {
    this.os = os;
    this.sep = sep;
  }


  template opSliceAssign(R) 
  {
    ostream_range opSliceAssign(R r)
    {
      foreach(x;r)
      {
        os.write(x);
        if(sep != "") os.writeString(sep);
      }

      return this;
    }
  }

  private OutputStream os;
  private string sep;
}

